﻿using API_Service.BizLogic.PartNo;
using Nancy;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace API_Service.Module
{
    public class PartNoModule : BaseAPIModule
    {
        private PartNoService partnoService = new PartNoService();

        public PartNoModule() : base("/partno")
        {
            Get["/"] = _ => Response.AsJson("partno module");

            #region PartNoModule API

            Get["/checkpartno"] = p =>
            {
                string para = p.parameter;
               
                ExecutionResult<dynamic> result = partnoService.GetPartNoByCode(para);

                return Response.AsJson(result);
            };

            #endregion


        }
    }
}